﻿using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DevSamPle.FormPlugin
{
    [Description("【表单插件】GetTreeViewData 树形控件"), HotUpdate]
    public class CustGetTreeViewData : AbstractDynamicFormPlugIn
    {
        private int nodeId = 999990;
        public override List<TreeNode> GetTreeViewData(TreeNodeArgs e)
        {
            if (e.NodeId == "0")
            {
                
            }
            var nodes = new List<TreeNode>();
            var node = new TreeNode();
            node.id = nodeId++.ToString();
            node.Number = "Number" + nodeId;
            node.Name = "Name" + nodeId;
            node.text = "Text" + nodeId;
            node.parentid = e.NodeId;
            node.cls = "parentnode";
            node.children = null;
            nodes.Add(node);
            node = new TreeNode();
            node.id = nodeId++.ToString();
            node.Number = "Number" + nodeId;
            node.Name = "Name" + nodeId;
            node.text = "Text" + nodeId;
            node.parentid = e.NodeId;
            node.cls = "parentnode";
            node.children = null;
            nodes.Add(node);
            return nodes;
        }
    }
}
